﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Input.Touch;
using Microsoft.Xna.Framework.Media;

namespace Pyramid_Game
{
    public class Bat
    {
        Texture2D texture;
        Vector2 position;

        int type;
        int turn;

        bool correct;

        public Texture2D BatTexture
        {
            get { return texture; }
        }
        public Vector2 Position
        {
            set { position = value; }
            get { return position; }
        }
        public int Type
        {
            set { type = value; }
            get { return type; }
        }
        public bool Correct
        {
            get { return correct; }
        }

        public Bat(int type, int turn, bool correct)
        {
            this.type = type;
            this.turn = turn;
            this.correct = correct;
        }

        public void LoadContent(ContentManager content)
        {
            texture = content.Load<Texture2D>("Texture/Bats/bat" + type);
            
            setPosition();
        }

        public void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(texture, position, Color.White);
        }

        public void setPosition()
        {
            int margin = 40;
            float width = texture.Width * (turn - 1) + margin * turn;
            float height = Game1.viewport.Height - margin - texture.Height;

            position = new Vector2(width, height);
        }
    }
}
